<?php

namespace Shared\Main;

use Doctrine\ORM\Mapping as ORM;
use Shared\LRC\Annotations as LRC;
use Shared\EventListener\AuditableInterface;
use Shared\LRC\Entity\TranslatableI;
use Shared\Main\ReadableCaptionInterface;

/**
 * 
 * @author Peter Yordanov <p.jordanov@object.bg>
 * @copyright (c) 2014, ASPECT.BG Ltd.
 * 
 * @ORM\Entity
 * @ORM\Table(name="labels")
 * @LRC\Entity
 */
class Label implements TranslatableI, AuditableInterface, ReadableCaptionInterface {

	/**
	 * @ORM\Id
	 * @ORM\GeneratedValue
	 * @ORM\Column(type="integer")
	 */
	protected $id;

	/**
	 * @ORM\Column(type="string")
	 */
	protected $slug;

	/**
	 * @LRC\Column
	 */
	protected $value;

	/**
	 * 
	 * @ORM\OneToMany(targetEntity="Shared\Main\LRC\Label", mappedBy="Object")
	 * @LRC\Translation
	 */
	protected $translations;

	public function __construct() {
		$this->translations = new \Doctrine\Common\Collections\ArrayCollection;
	}

	public function getReadableCaption() {
		return $this->getValue();
	}

	public function getTranslations() {
		return $this->translations;
	}

	public function setTranslations($translations) {
		$this->translations = $translations;
	}

	public function getId() {
		return $this->id;
	}

	public function setId($id) {
		$this->id = $id;
	}

	public function getSlug() {
		return $this->slug;
	}

	public function setSlug($slug) {
		$this->slug = $slug;
	}

	public function getValue() {
		return $this->value;
	}

	public function setValue($value) {
		$this->value = $value;
	}

}
